#include"mock_C++_thread.hpp"
#include<unistd.h>
#include<cstdlib>
#include<memory>

using namespace std;

void* start_routine(void * arg)
{
  int counter = 10;
  while(counter--){
    printf("%s\n", (char*)arg);
    sleep(1);
  }
}


int main()
{
  char buff[64] = {0};
  snprintf(buff, sizeof buff, "我是新创建的线程，我正在执行...");

  std::unique_ptr<mock_thread> test(new mock_thread(start_routine, (void*)buff, 1));
  test->start();
  test->join();
  return 0;
}